//DEFINE(IA64_TASK_SIGHAND_OFFSET,offsetof (struct task_struct, sighand));
//DEFINE(IA64_TASK_SIGNAL_OFFSET,offsetof (struct task_struct, signal));
//DEFINE(IA64_TASK_TGID_OFFSET, offsetof (struct task_struct, tgid));
- DEFINE(IA64_TASK_THREAD_KSP_OFFSET, offsetof (struct exec_domain, arch._thread.ksp));
- DEFINE(IA64_TASK_THREAD_ON_USTACK_OFFSET, offsetof (struct exec_domain, arch._thread.on_ustack));
+ DEFINE(IA64_TASK_THREAD_KSP_OFFSET, offsetof (struct vcpu, arch._thread.ksp));
+ DEFINE(IA64_TASK_THREAD_ON_USTACK_OFFSET, offsetof (struct vcpu, arch._thread.on_ustack));
- DEFINE(IA64_VCPU_META_RR0_OFFSET, offsetof (struct exec_domain, arch.metaphysical_rr0));
- DEFINE(IA64_VCPU_META_SAVED_RR0_OFFSET, offsetof (struct exec_domain, arch.metaphysical_saved_rr0));
- DEFINE(IA64_VCPU_BREAKIMM_OFFSET, offsetof (struct exec_domain, arch.breakimm));
- DEFINE(IA64_VCPU_IVA_OFFSET, offsetof (struct exec_domain, arch.iva));
++ DEFINE(IA64_VCPU_META_RR0_OFFSET, offsetof (struct vcpu, arch.metaphysical_rr0));
++ DEFINE(IA64_VCPU_META_SAVED_RR0_OFFSET, offsetof (struct vcpu, arch.metaphysical_saved_rr0));
++ DEFINE(IA64_VCPU_BREAKIMM_OFFSET, offsetof (struct vcpu, arch.breakimm));
++ DEFINE(IA64_VCPU_IVA_OFFSET, offsetof (struct vcpu, arch.iva));
+
BLANK();
//DEFINE(IA64_SIGHAND_SIGLOCK_OFFSET,offsetof (struct sighand_struct, siglock));
}
#endif
d->max_pages = (128*1024*1024)/PAGE_SIZE; // 128MB default // FIXME
- if ((d->metaphysical_rid = allocate_metaphysical_rid()) == -1UL)
+ if ((d->arch.metaphysical_rr0 = allocate_metaphysical_rr0()) == -1UL)
BUG();
- ed->vcpu_info->arch.metaphysical_mode = 1;
- ed->arch.metaphysical_rr0 = d->arch.metaphysical_rr0;
- ed->arch.metaphysical_saved_rr0 = d->arch.metaphysical_rr0;
+ v->vcpu_info->arch.metaphysical_mode = 1;
++ v->arch.metaphysical_rr0 = d->arch.metaphysical_rr0;
++ v->arch.metaphysical_saved_rr0 = d->arch.metaphysical_rr0;
#define DOMAIN_RID_BITS_DEFAULT 18
if (!allocate_rid_range(d,DOMAIN_RID_BITS_DEFAULT)) // FIXME
BUG();
printf("bad hyperprivop; ignored\n");
return 1;
}
- hyperpriv_cnt[iim]++;
+ slow_hyperpriv_cnt[iim]++;
switch(iim) {
case HYPERPRIVOP_RFI:
- (void)vcpu_rfi(ed);
+ (void)vcpu_rfi(v);
return 0; // don't update iip
case HYPERPRIVOP_RSM_DT:
- (void)vcpu_reset_psr_dt(ed);
+ (void)vcpu_reset_psr_dt(v);
return 1;
case HYPERPRIVOP_SSM_DT:
- (void)vcpu_set_psr_dt(ed);
+ (void)vcpu_set_psr_dt(v);
return 1;
case HYPERPRIVOP_COVER:
- (void)vcpu_cover(ed);
+ (void)vcpu_cover(v);
return 1;
case HYPERPRIVOP_ITC_D:
inst.inst = 0;
return 1;
case HYPERPRIVOP_ITC_I:
inst.inst = 0;
- (void)priv_itc_i(ed,inst);
+ (void)priv_itc_i(v,inst);
return 1;
+ case HYPERPRIVOP_SSM_I:
+ (void)vcpu_set_psr_i(ed);
+ return 1;
}
return 0;
}
return ((pteval & _PAGE_PPN_MASK) | (mpaddr & ~PAGE_MASK));
}
+ unsigned long slow_reflect_count[0x80] = { 0 };
+ unsigned long fast_reflect_count[0x80] = { 0 };
+
+ #define inc_slow_reflect_count(vec) slow_reflect_count[vec>>8]++;
+
+ void zero_reflect_counts(void)
+ {
+ int i;
+ for (i=0; i<0x80; i++) slow_reflect_count[i] = 0;
+ for (i=0; i<0x80; i++) fast_reflect_count[i] = 0;
+ }
+
+ int dump_reflect_counts(char *buf)
+ {
+ int i,j,cnt;
+ char *s = buf;
+
+ s += sprintf(s,"Slow reflections by vector:\n");
+ for (i = 0, j = 0; i < 0x80; i++) {
+ if (cnt = slow_reflect_count[i]) {
+ s += sprintf(s,"0x%02x00:%10d, ",i,cnt);
+ if ((j++ & 3) == 3) s += sprintf(s,"\n");
+ }
+ }
+ if (j & 3) s += sprintf(s,"\n");
+ s += sprintf(s,"Fast reflections by vector:\n");
+ for (i = 0, j = 0; i < 0x80; i++) {
+ if (cnt = fast_reflect_count[i]) {
+ s += sprintf(s,"0x%02x00:%10d, ",i,cnt);
+ if ((j++ & 3) == 3) s += sprintf(s,"\n");
+ }
+ }
+ if (j & 3) s += sprintf(s,"\n");
+ return s - buf;
+ }
+
void reflect_interruption(unsigned long ifa, unsigned long isr, unsigned long itiriim, struct pt_regs *regs, unsigned long vector)
{
- unsigned long vcpu_get_ipsr_int_state(struct exec_domain *,unsigned long);
- unsigned long vcpu_get_rr_ve(struct exec_domain *,unsigned long);
+ unsigned long vcpu_get_ipsr_int_state(struct vcpu *,unsigned long);
+ unsigned long vcpu_get_rr_ve(struct vcpu *,unsigned long);
struct domain *d = current->domain;
- struct exec_domain *ed = current;
+ struct vcpu *v = current;
if (vector == IA64_EXTINT_VECTOR) {
}
//printf("Delivering NESTED DATA TLB fault\n");
vector = IA64_DATA_NESTED_TLB_VECTOR;
- regs->cr_iip = ((unsigned long) PSCBX(ed,iva) + vector) & ~0xffUL;
+ regs->cr_iip = ((unsigned long) PSCBX(v,iva) + vector) & ~0xffUL;
regs->cr_ipsr = (regs->cr_ipsr & ~DELIVER_PSR_CLR) | DELIVER_PSR_SET;
// NOTE: nested trap must NOT pass PSCB address
- //regs->r31 = (unsigned long) &PSCB(ed);
+ //regs->r31 = (unsigned long) &PSCB(v);
+ inc_slow_reflect_count(vector);
return;
}
#endif
regs->r31 = &((shared_info_t *)SHAREDINFO_ADDR)->vcpu_data[0].arch;
- PSCB(ed,interrupt_delivery_enabled) = 0;
- PSCB(ed,interrupt_collection_enabled) = 0;
+ PSCB(v,interrupt_delivery_enabled) = 0;
+ PSCB(v,interrupt_collection_enabled) = 0;
+
+ inc_slow_reflect_count(vector);
}
void foodpi(void) {}
{
ia64_rr rrv;
+ rrv.rrval = 0;
+ rrv.rid = v->domain->metaphysical_rid;
+ rrv.rrval = ed->domain->arch.metaphysical_rr0;
rrv.ps = PAGE_SHIFT;
rrv.ve = 1;
-if (!ed->vcpu_info) { printf("Stopping in init_all_rr\n"); dummy(); }
- ed->vcpu_info->arch.rrs[0] = -1;
- ed->vcpu_info->arch.rrs[1] = rrv.rrval;
- ed->vcpu_info->arch.rrs[2] = rrv.rrval;
- ed->vcpu_info->arch.rrs[3] = rrv.rrval;
- ed->vcpu_info->arch.rrs[4] = rrv.rrval;
- ed->vcpu_info->arch.rrs[5] = rrv.rrval;
+if (!v->vcpu_info) { printf("Stopping in init_all_rr\n"); dummy(); }
+ v->vcpu_info->arch.rrs[0] = -1;
+ v->vcpu_info->arch.rrs[1] = rrv.rrval;
+ v->vcpu_info->arch.rrs[2] = rrv.rrval;
+ v->vcpu_info->arch.rrs[3] = rrv.rrval;
+ v->vcpu_info->arch.rrs[4] = rrv.rrval;
+ v->vcpu_info->arch.rrs[5] = rrv.rrval;
rrv.ve = 0;
- ed->vcpu_info->arch.rrs[6] = rrv.rrval;
-// ed->shared_info->arch.rrs[7] = rrv.rrval;
+ v->vcpu_info->arch.rrs[6] = rrv.rrval;
+// v->shared_info->arch.rrs[7] = rrv.rrval;
}
// TODO: These probably should be validated
unsigned long bad = 0;
- if (ed->vcpu_info->arch.metaphysical_mode) {
+ if (v->vcpu_info->arch.metaphysical_mode) {
ia64_rr rrv;
- rrv.rrval = ed->domain->arch.metaphysical_rr0;
+ rrv.rrval = 0;
+ rrv.rid = v->domain->metaphysical_rid;
+ rrv.ps = PAGE_SHIFT;
++ rrv.rrval = v->domain->arch.metaphysical_rr0;
rrv.ve = 1;
rr0 = rrv.rrval;
set_rr_no_srlz(0x0000000000000000L, rr0);